
package controller;

import entity.Content;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import service.ContentService;

@WebServlet("/ContentBodyServlet")
public class ContentBody extends HttpServlet{
    ContentService contentService=new ContentService();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
      String id =req.getParameter("id");
      Content content=contentService.selectContentdById(Integer.parseInt(id));
      req.setAttribute("content", content);
      req.getRequestDispatcher("content-body.jsp").forward(req, resp);
    }
    
    
    
}
